using System;

namespace DockerPlay
{
    public class ContainerStatus
    {
        public Guid Id { get; set; }
        public ContainerName Name { get; set; }
        public string ContainerId { get; set; }
        public DockerContainerState State { get; set; }
        public DateTime Date { get; set; }
    }
    public enum ContainerName
    {
        /// <summary>
        /// Start a as app database. Ip 172.18.0.3: 27017
        /// </summary>
        ga_mongo_a_27017,
        /// <summary>
        /// Start a as sync database
        /// </summary>
        ga_mongo_a_27018,
        /// <summary>
        /// Start b as sync database
        /// </summary>
        ga_mongo_b_27018,
        /// <summary>
        /// Start b as app database. Ip 172.18.0.3: 27017
        /// </summary>
        ga_mongo_b_27017,

        /// <summary>
        /// Copy data from a to b 
        /// </summary>
        ga_backup_from_a,
        /// <summary>
        /// Copy data from b to a
        /// </summary>
        ga_backup_from_b,
        /// <summary>
        /// Config server for sharding
        /// </summary>
        config_server,
        /// <summary>
        /// Query router
        /// </summary>
        query_router,
        /// <summary>
        /// Client platform. Ip 172.18.0.5:27017
        /// </summary>
        ga_mongo_CP

    }
    public enum DockerContainerState
    {
        running,
        exited
    }

    public static class EnumUtil
    {
        public static T ParseEnum<T>(string value)
        {
            return (T)Enum.Parse(typeof(T), value, true);
        }
        public static T ToEnum<T>(this string value)
        {
            return (T)Enum.Parse(typeof(T), value, true);
        }
    }
}